# 页面类
import time

from selenium.webdriver.common.by import By
from Base.Base import Base
class Page(Base):
    # 定位器
    # 输入框的定位
    # 点击请登录 class="headerLogin"
    login_loc=(By.CLASS_NAME,'headerLogin')
    # 输入用户名id="userName"
    username_loc=(By.ID,'userName')
    # 输入密码id="password"
    password_loc=(By.ID,'password')
    # 等待10分钟输入验证码
    # 点击登录name="bi_Usuallogin"
    dian_login_loc=(By.NAME,'bi_Usuallogin')
    # 点击确定class="bindSub"
    dian_query_loc=(By.CLASS_NAME,'bindSub')



    # 页面元素的封装
    # 点击请登录 class="headerLogin"
    def login(self):
        self.click(self.login_loc)
    # 输入用户名id="userName"
    def username(self):
        self.send_keys(self.username_loc,"13485456209")
    # 输入密码id="password"
    def password(self):
        self.send_keys(self.password_loc,"123456Aa")
    # 等待10分钟输入验证码
    # 点击登录name="bi_Usuallogin"
    def dianlogin(self):
        self.click(self.dian_login_loc)
    # 点击确定class="bindSub"
    def dianquery(self):
        self.click(self.dian_query_loc)
    def test_luoji(self):
        self.open_url('https://www.jiuxian.com/')
        self.login()
        self.username()
        self.password()
        time.sleep(10)
        self.dianlogin()
        self.dianquery()







